<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="zh-CN">
<head>
    <title>试卷界面</title>

    <th:block th:include="fragment_header :: header">
    </th:block>
</head>
<body>
<div th:replace="fragment_menu :: navmenu"></div>
<div class="container mt-5">
    <h1>试卷预览</h1>
    <div class="d-flex justify-content-end"> <!-- Align items to the right -->
        <form th:action="@{/navigateQuestion}" method="get">
            <h5 class="text-muted" style="padding: 10px 10px">请选题目编号</h5>
            <div class="form-floating mb-3 mt-3">
                <select class="form-select" id="sel1" name="exam">
                    <option th:each="num: ${exam_nums}" th:selected="${{param.exam}} eq ${num}"
                            th:text="${num}">考试信息
                    </option>
                </select>
            </div>

            <!--      <select name="selectedQuestionId" onchange="this.form.submit()">-->
            <!--        <option value="">&#45;&#45; 选择题目 &#45;&#45;</option>-->
            <!--        <option th:each="num : ${exam_num}" th:text="${num}"></option>-->
            <!--      </select>-->
        </form>
    </div>
    <div class="question" id="question-1">
        <tr th:each="question: ${questions}">
            <p th:text="${question.description}"><strong>1. 题目：1+1=？</strong></p>
            <p th:text="${question.options.get(0)}">A. <span class="correct-answer">1</span></p>
            <p th:text="${question.options.get(1)}">B. <span>2</span></p>
            <p th:text="${question.options.get(2)}">C. <span>3</span></p>
            <p th:text="${question.options.get(3)}">D. <span>4</span></p>
        </tr>
    </div>
    <!--  <h2>试题内容：</h2>-->
    <!--  <ul>-->
    <!--    <li th:each="question : ${selectedQuestions}">-->
    <!--      &lt;!&ndash; Display the selected question details here &ndash;&gt;-->
    <!--      <p th:text="${question.description}"></p>-->
    <!--      <ul>-->
    <!--        <li th:each="option : ${question.options}">-->
    <!--          <span th:text="${option.choice}"></span>-->
    <!--          <span th:text="${option.answer}"></span>-->
    <!--        </li>-->
    <!--      </ul>-->
    <!--    </li>-->
    <!--  </ul>-->
    <div class="text-right mt-5">
        <a href="/" class="btn btn-secondary">返回</a>
    </div>
</div>
</body>
</html>
